Skip to content

Conversation

huozhi
Copy link
Member

@huozhi huozhi commented Oct 3, 2025

In v6, the params argument of metadata image routes will become params, which is aligned with other page routes in App Router.
The 2nd argument id will become Promise<string> if you use generateImageMetadata

@ijjk ijjk added created-by: Next.js team PRs by the Next.js team. Documentation Related to Next.js' official documentation. labels Oct 3, 2025
@huozhi huozhi marked this pull request as ready for review October 3, 2025 14:29
@huozhi huozhi requested a review from icyJoseph October 3, 2025 14:30
| `app/shop/[tag]/[item]/opengraph-image.js` | `/shop/1/2` | `{ tag: '1', item: '2' }` |
| Route | URL | `params` |
| ------------------------------------------ | ----------- | ---------------------------------- |
| `app/shop/opengraph-image.js` | `/shop` | `Promise<undefined>` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@huozhi I guess this one is technically correct though? or will the entire params object be undefined?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yea this shouldn't change

| Route | URL | `params` |
| ------------------------------- | ----------- | ---------------------------------- |
| `app/shop/icon.js` | `/shop` | `Promise<undefined>` |
| `app/shop/[slug]/icon.js` | `/shop/1` | `Promise<{ slug: '1' >}` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a syntax error in the Promise type declaration. The closing bracket is misplaced - it should be Promise<{ slug: '1' }> rather than Promise<{ slug: '1' >}.

Suggested change
| `app/shop/[slug]/icon.js` | `/shop/1` | `Promise<{ slug: '1' >}` |
| `app/shop/[slug]/icon.js` | `/shop/1` | `Promise<{ slug: '1' }>` |

Spotted by Graphite Agent

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

This comment came from an experimental review—please leave feedback if it was helpful/unhelpful. Learn more about experimental comments here.

@huozhi huozhi merged commit c08e05f into canary Oct 8, 2025
76 checks passed
@huozhi huozhi deleted the update-metadata-images-docs branch October 8, 2025 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

created-by: Next.js team PRs by the Next.js team. Documentation Related to Next.js' official documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants